Skip to content

Conversation

@FFroehlich
Copy link
Member

remove user facing instantiations of JaxModel in favour of directly instantiating JaxProblem.

@FFroehlich FFroehlich requested a review from a team as a code owner November 1, 2025 08:06
@FFroehlich FFroehlich requested review from Copilot and removed request for a team November 1, 2025 08:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the import_petab_problem function to directly return a JAXProblem instance when jax=True, instead of returning a JAXModel that users must manually wrap. This simplifies the API by eliminating the need for users to explicitly create JAXProblem(jax_model, petab_problem).

Key changes:

  • Modified import_petab_problem to return JAXProblem instead of JAXModel when jax=True
  • Updated all test files and examples to use the simplified API by removing manual JAXProblem instantiation
  • Removed unused JAXProblem import from test files where it's no longer needed

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
python/sdist/amici/petab/petab_import.py Updated return type annotation and implementation to create and return JAXProblem directly when jax=True
tests/benchmark_models/test_petab_benchmark_jax.py Removed manual JAXProblem instantiation and unused import
python/tests/test_jax.py Updated multiple test functions to use the simplified API without manual JAXProblem creation
doc/examples/example_jax_petab/ExampleJaxPEtab.ipynb Updated tutorial to reflect new API, including documentation and variable references

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@FFroehlich FFroehlich requested a review from dweindl November 1, 2025 08:15
@codecov
Copy link

codecov bot commented Nov 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.05%. Comparing base (4360d5e) to head (19518d3).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2998      +/-   ##
==========================================
- Coverage   76.73%   76.05%   -0.68%     
==========================================
  Files         309      309              
  Lines       19884    19884              
  Branches     1498     1498              
==========================================
- Hits        15258    15123     -135     
- Misses       4613     4748     +135     
  Partials       13       13              
Flag Coverage Δ
cpp 72.55% <ø> (ø)
cpp_python 37.72% <ø> (ø)
petab 38.59% <ø> (ø)
petab_sciml 14.15% <ø> (ø)
python 69.37% <ø> (ø)
sbmlsuite-jax ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
python/sdist/amici/petab/petab_import.py 100.00% <ø> (ø)

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 1, 2025

@FFroehlich FFroehlich added this pull request to the merge queue Nov 1, 2025
Merged via the queue into main with commit 5e285f8 Nov 1, 2025
21 of 22 checks passed
@FFroehlich FFroehlich deleted the refactor_jax branch November 3, 2025 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants